package cn.com.dbappsecurity.service.impl;

import cn.com.dbappsecurity.frame.proxy.FrameProxy;

/**
 * service基类
 * @author dhz
 */
public class BaseServiceImpl {

	protected BaseServiceImpl(){
	}
	
	protected <T> T getMapper(Class<T> clasz){
		return FrameProxy.newProxyDaoInstance(clasz);
	}
	
	/**
	 * 获取查询开始条
	 * @param page
	 * @param rows
	 * @return
	 */
	protected int getLimit(int page,int rows){
		if(page < 1){
			page = 1;
		}
		return (page - 1) * rows;
	}
}
